home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: Mailbox/MIME Entity
(archive/mbox).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Newsgroup Content (archive/news)
| magic
| Supported |
100%
| dexvert
| Mailbox/MIME Entity (archive/mbox)
| magic
| Supported |
100%
| dexvert
| Internet Message Format (text/imf)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| news, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| dexmagic
| PrintFox/Pagefox WEAK
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/950 MIME Email (1.0)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| message/news
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 6e 6e | 74 70 64 32 2e 63 78 6f |Path: nn|tpd2.cxo|
|00000010| 2e 64 65 63 2e 63 6f 6d | 21 75 73 65 6e 65 74 0a |.dec.com|!usenet.|
|00000020| 46 72 6f 6d 3a 20 42 72 | 69 61 6e 20 48 69 62 62 |From: Br|ian Hibb|
|00000030| 65 72 74 20 3c 62 5f 68 | 69 62 62 65 72 74 40 63 |ert <b_h|ibbert@c|
|00000040| 73 63 33 32 2e 65 6e 65 | 74 2e 64 65 63 2e 63 6f |sc32.ene|t.dec.co|
|00000050| 6d 3e 0a 4e 65 77 73 67 | 72 6f 75 70 73 3a 20 63 |m>.Newsg|roups: c|
|00000060| 6f 6d 70 2e 6c 61 6e 67 | 2e 63 2b 2b 0a 53 75 62 |omp.lang|.c++.Sub|
|00000070| 6a 65 63 74 3a 20 52 65 | 3a 20 44 6f 65 73 20 74 |ject: Re|: Does t|
|00000080| 68 69 73 20 63 72 65 61 | 74 65 20 6d 65 6d 6f 72 |his crea|te memor|
|00000090| 79 20 6c 65 61 6b 3f 2e | 2e 2e 0a 44 61 74 65 3a |y leak?.|...Date:|
|000000a0| 20 31 36 20 46 65 62 20 | 31 39 39 36 20 32 30 3a | 16 Feb |1996 20:|
|000000b0| 30 34 3a 34 39 20 47 4d | 54 0a 4f 72 67 61 6e 69 |04:49 GM|T.Organi|
|000000c0| 7a 61 74 69 6f 6e 3a 20 | 44 69 67 69 74 61 6c 20 |zation: |Digital |
|000000d0| 45 71 75 69 70 6d 65 6e | 74 20 43 6f 72 70 6f 72 |Equipmen|t Corpor|
|000000e0| 61 74 69 6f 6e 0a 4d 65 | 73 73 61 67 65 2d 49 44 |ation.Me|ssage-ID|
|000000f0| 3a 20 3c 34 67 32 6f 31 | 31 24 6c 31 31 40 6e 6e |: <4g2o1|1$l11@nn|
|00000100| 74 70 64 32 2e 63 78 6f | 2e 64 65 63 2e 63 6f 6d |tpd2.cxo|.dec.com|
|00000110| 3e 0a 52 65 66 65 72 65 | 6e 63 65 73 3a 20 3c 33 |>.Refere|nces: <3|
|00000120| 31 32 33 44 46 36 38 2e | 31 36 37 37 40 73 69 65 |123DF68.|1677@sie|
|00000130| 72 72 61 2e 6e 65 74 3e | 0a 4e 4e 54 50 2d 50 6f |rra.net>|.NNTP-Po|
|00000140| 73 74 69 6e 67 2d 48 6f | 73 74 3a 20 70 65 6f 31 |sting-Ho|st: peo1|
|00000150| 30 31 32 5f 70 6f 72 74 | 32 2e 70 65 6f 2e 64 65 |012_port|2.peo.de|
|00000160| 63 2e 63 6f 6d 0a 4d 69 | 6d 65 2d 56 65 72 73 69 |c.com.Mi|me-Versi|
|00000170| 6f 6e 3a 20 31 2e 30 0a | 43 6f 6e 74 65 6e 74 2d |on: 1.0.|Content-|
|00000180| 54 79 70 65 3a 20 74 65 | 78 74 2f 70 6c 61 69 6e |Type: te|xt/plain|
|00000190| 3b 20 63 68 61 72 73 65 | 74 3d 75 73 2d 61 73 63 |; charse|t=us-asc|
|000001a0| 69 69 0a 43 6f 6e 74 65 | 6e 74 2d 54 72 61 6e 73 |ii.Conte|nt-Trans|
|000001b0| 66 65 72 2d 45 6e 63 6f | 64 69 6e 67 3a 20 37 62 |fer-Enco|ding: 7b|
|000001c0| 69 74 0a 58 2d 4d 61 69 | 6c 65 72 3a 20 4d 6f 7a |it.X-Mai|ler: Moz|
|000001d0| 69 6c 6c 61 20 31 2e 32 | 4e 20 28 57 69 6e 64 6f |illa 1.2|N (Windo|
|000001e0| 77 73 3b 20 49 3b 20 31 | 36 62 69 74 29 0a 54 6f |ws; I; 1|6bit).To|
|000001f0| 3a 20 73 6e 6f 77 62 75 | 6c 6c 40 73 69 65 72 72 |: snowbu|ll@sierr|
|00000200| 61 2e 6e 65 74 0a 0a 54 | 20 43 6f 6c 77 65 6c 6c |a.net..T| Colwell|
|00000210| 20 3c 73 6e 6f 77 62 75 | 6c 6c 40 73 69 65 72 72 | <snowbu|ll@sierr|
|00000220| 61 2e 6e 65 74 3e 20 77 | 72 6f 74 65 3a 0a 3e 54 |a.net> w|rote:.>T|
|00000230| 68 65 20 63 6f 64 65 20 | 77 68 69 63 68 20 66 6f |he code |which fo|
|00000240| 6c 6c 6f 77 73 20 73 65 | 61 6d 73 20 6c 69 6b 65 |llows se|ams like|
|00000250| 20 69 74 20 77 6f 75 6c | 64 20 63 72 65 61 74 65 | it woul|d create|
|00000260| 20 61 20 6d 65 6d 6f 72 | 79 20 6c 65 61 6b 2e 20 | a memor|y leak. |
|00000270| 20 54 68 65 20 43 41 54 | 20 63 6c 61 73 73 20 63 | The CAT| class c|
|00000280| 6f 6e 74 61 69 6e 73 20 | 6d 65 6d 62 65 72 20 70 |ontains |member p|
|00000290| 6f 69 6e 74 65 72 73 20 | 74 6f 20 0a 3e 6f 62 6a |ointers |to .>obj|
|000002a0| 65 63 74 73 20 6f 6e 20 | 74 68 65 20 68 65 61 70 |ects on |the heap|
|000002b0| 2e 20 20 57 68 65 6e 20 | 79 6f 75 20 74 61 6b 65 |. When |you take|
|000002c0| 20 61 6e 20 65 78 69 73 | 74 69 6e 67 20 6f 62 6a | an exis|ting obj|
|000002d0| 65 63 74 20 61 74 20 72 | 65 61 73 73 69 67 6e 20 |ect at r|eassign |
|000002e0| 69 74 20 76 69 61 20 61 | 6e 20 6f 76 65 72 72 69 |it via a|n overri|
|000002f0| 64 64 65 6e 20 61 73 73 | 69 67 6e 6d 65 6e 74 20 |dden ass|ignment |
|00000300| 6f 70 65 72 61 74 6f 72 | 20 74 6f 20 0a 3e 61 20 |operator| to .>a |
|00000310| 73 65 63 6f 6e 64 20 6f | 62 6a 65 63 74 20 6f 66 |second o|bject of|
|00000320| 20 74 68 65 20 73 61 6d | 65 20 74 79 70 65 2c 20 | the sam|e type, |
|00000330| 77 68 61 74 20 68 61 70 | 70 65 6e 73 20 74 6f 20 |what hap|pens to |
|00000340| 74 68 65 20 64 61 74 61 | 20 61 74 20 74 68 65 20 |the data| at the |
|00000350| 6f 72 69 67 69 6e 61 6c | 6c 79 20 70 6f 69 6e 74 |original|ly point|
|00000360| 65 64 2d 74 6f 20 61 64 | 64 72 65 73 73 3f 20 20 |ed-to ad|dress? |
|00000370| 48 65 72 65 27 73 20 77 | 68 61 74 20 49 20 0a 3e |Here's w|hat I .>|
|00000380| 6d 65 61 6e 3a 0a 0a 4e | 6f 74 68 69 6e 67 20 68 |mean:..N|othing h|
|00000390| 61 70 70 65 6e 73 20 74 | 6f 20 74 68 65 20 64 61 |appens t|o the da|
|000003a0| 74 61 20 69 66 20 79 6f | 75 20 64 6f 6e 27 74 20 |ta if yo|u don't |
|000003b0| 64 6f 20 61 6e 79 74 68 | 69 6e 67 20 74 6f 20 66 |do anyth|ing to f|
|000003c0| 72 65 65 20 69 74 20 6f | 72 20 0a 6f 74 68 65 72 |ree it o|r .other|
|000003d0| 77 69 73 65 20 6d 6f 64 | 69 66 79 20 69 74 2e 20 |wise mod|ify it. |
|000003e0| 20 57 68 61 74 20 68 61 | 70 70 65 6e 73 20 69 73 | What ha|ppens is|
|000003f0| 20 74 68 65 20 6d 65 6d | 6f 72 65 79 20 69 73 20 | the mem|orey is |
|00000400| 73 74 69 6c 6c 20 61 6c | 6c 6f 63 61 74 65 64 2c |still al|located,|
|00000410| 20 62 75 74 20 0a 6e 6f | 74 68 69 6e 67 20 70 6f | but .no|thing po|
|00000420| 69 6e 74 73 20 74 6f 20 | 74 68 65 20 64 61 74 61 |ints to |the data|
|00000430| 2e 20 20 54 68 65 72 65 | 20 69 73 20 6e 6f 20 77 |. There| is no w|
|00000440| 61 79 20 74 6f 20 72 65 | 61 73 6f 6e 61 62 6c 79 |ay to re|asonably|
|00000450| 20 72 65 63 6f 76 65 72 | 20 74 68 69 73 0a 64 61 | recover| this.da|
|00000460| 74 61 20 6f 72 20 66 72 | 65 65 20 74 68 65 20 6d |ta or fr|ee the m|
|00000470| 65 6d 6f 72 79 20 6f 6e | 63 65 20 79 6f 75 20 68 |emory on|ce you h|
|00000480| 61 76 65 20 6c 6f 73 74 | 20 74 68 65 20 70 6f 69 |ave lost| the poi|
|00000490| 6e 74 65 72 2e 20 20 0a | 0a 20 20 20 41 6e 79 20 |nter. .|. Any |
|000004a0| 64 65 63 65 6e 74 20 43 | 20 6f 72 20 43 2b 2b 20 |decent C| or C++ |
|000004b0| 70 72 6f 67 72 61 6d 6d | 69 6e 67 20 62 6f 6f 6b |programm|ing book|
|000004c0| 20 73 68 6f 75 6c 64 20 | 64 69 73 63 75 73 73 20 | should |discuss |
|000004d0| 68 65 61 70 20 6d 61 6e | 61 67 65 6d 65 6e 74 2e |heap man|agement.|
|000004e0| 0a 49 20 77 6f 75 6c 64 | 20 73 75 67 67 65 73 74 |.I would| suggest|
|000004f0| 20 67 65 74 74 69 6e 67 | 20 61 20 43 2b 2b 20 6d | getting| a C++ m|
|00000500| 61 6e 75 61 6c 20 73 69 | 6e 63 65 20 69 74 20 73 |anual si|nce it s|
|00000510| 68 6f 75 6c 64 20 64 65 | 61 6c 20 77 69 74 68 20 |hould de|al with |
|00000520| 74 6f 70 69 63 73 20 0a | 73 75 63 68 20 61 73 20 |topics .|such as |
|00000530| 63 6f 70 79 20 63 6f 6e | 74 72 75 63 74 6f 72 73 |copy con|tructors|
|00000540| 2c 20 64 65 73 74 72 75 | 63 74 6f 72 73 20 61 6e |, destru|ctors an|
|00000550| 64 20 61 73 73 69 67 6e | 6d 65 6e 74 20 6f 70 65 |d assign|ment ope|
|00000560| 72 61 74 6f 72 73 20 61 | 6e 64 20 68 65 61 70 20 |rators a|nd heap |
|00000570| 0a 6d 61 6e 67 65 6d 65 | 6e 74 2e 0a 0a 0a 2d 2d |.mangeme|nt....--|
|00000580| 20 53 6e 69 70 20 2d 2d | 0a 0a 3e 20 20 43 41 54 | Snip --|..> CAT|
|00000590| 20 43 41 54 3a 3a 6f 70 | 65 72 61 74 6f 72 3d 28 | CAT::op|erator=(|
|000005a0| 63 6f 6e 73 74 20 43 41 | 54 20 26 20 72 68 73 29 |const CA|T & rhs)|
|000005b0| 0a 3e 20 20 7b 0a 3e 20 | 20 20 20 20 69 66 20 28 |.> {.> | if (|
|000005c0| 74 68 69 73 20 3d 3d 20 | 26 72 68 73 29 0a 3e 20 |this == |&rhs).> |
|000005d0| 20 20 20 20 20 20 20 72 | 65 74 75 72 6e 20 2a 74 | r|eturn *t|
|000005e0| 68 69 73 3b 0a 2f 2f 20 | 79 6f 75 20 6e 65 65 64 |his;.// |you need|
|000005f0| 20 74 6f 20 61 64 64 20 | 73 6f 6d 65 20 64 65 6c | to add |some del|
|00000600| 65 74 65 20 73 74 61 74 | 65 6d 65 6e 74 73 20 68 |ete stat|ements h|
|00000610| 65 72 65 20 74 6f 20 64 | 65 6c 65 74 65 20 74 68 |ere to d|elete th|
|00000620| 65 20 69 74 65 6d 73 0a | 2f 2f 20 74 68 61 74 20 |e items.|// that |
|00000630| 77 65 72 65 20 61 6c 6c | 6f 63 61 74 65 64 20 66 |were all|ocated f|
|00000640| 72 6f 6d 20 74 68 65 20 | 68 65 61 70 2e 0a 20 20 |rom the |heap.. |
|00000650| 20 20 20 20 20 20 20 64 | 65 6c 65 74 65 20 69 74 | d|elete it|
|00000660| 73 41 67 65 3b 0a 20 20 | 20 20 20 20 20 20 20 64 |sAge;. | d|
|00000670| 65 6c 65 74 65 20 69 74 | 73 57 65 69 67 68 74 3b |elete it|sWeight;|
|00000680| 0a 0a 3e 20 20 20 20 20 | 20 20 20 69 74 73 41 67 |..> | itsAg|
|00000690| 65 20 3d 20 6e 65 77 20 | 69 6e 74 3b 0a 3e 20 20 |e = new |int;.> |
|000006a0| 20 20 20 20 20 20 69 74 | 73 57 65 69 67 68 74 20 | it|sWeight |
|000006b0| 3d 20 6e 65 77 20 69 6e | 74 3b 0a 3e 20 20 20 20 |= new in|t;.> |
|000006c0| 20 20 20 20 2a 69 74 73 | 41 67 65 20 3d 20 72 68 | *its|Age = rh|
|000006d0| 73 2e 47 65 74 41 67 65 | 28 29 3b 0a 3e 20 20 20 |s.GetAge|();.> |
|000006e0| 20 20 20 20 20 2a 69 74 | 73 57 65 69 67 68 74 20 | *it|sWeight |
|000006f0| 3d 20 72 68 73 2e 47 65 | 74 57 65 69 67 68 74 28 |= rhs.Ge|tWeight(|
|00000700| 29 3b 0a 3e 20 20 7d 0a | 3e 0a 2d 2d 20 53 6e 69 |);.> }.|>.-- Sni|
|00000710| 70 20 2d 2d 2d 0a 3e 2a | 2a 2a 2a 2a 2a 2a 2a 2a |p ---.>*|********|
|00000720| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000730| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000740| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 0a 3e 0a 3e 54 68 65 |********|*.>.>The|
|00000750| 20 61 73 73 69 67 6e 6d | 65 6e 74 20 6f 70 65 72 | assignm|ent oper|
|00000760| 61 74 6f 72 20 72 65 69 | 6e 69 74 69 61 6c 69 7a |ator rei|nitializ|
|00000770| 65 73 20 69 74 73 41 67 | 65 20 61 6e 64 20 69 74 |es itsAg|e and it|
|00000780| 73 57 65 69 67 68 74 20 | 74 6f 20 70 6f 69 6e 74 |sWeight |to point|
|00000790| 20 74 6f 20 6e 65 77 20 | 68 65 61 70 20 61 64 64 | to new |heap add|
|000007a0| 72 65 73 73 65 73 2c 20 | 77 68 61 74 20 68 61 70 |resses, |what hap|
|000007b0| 70 65 6e 73 20 74 6f 20 | 74 68 65 20 0a 3e 61 64 |pens to |the .>ad|
|000007c0| 64 72 65 73 73 65 73 20 | 74 68 65 79 20 77 65 72 |dresses |they wer|
|000007d0| 65 20 70 6f 69 6e 74 69 | 6e 67 20 74 6f 20 62 65 |e pointi|ng to be|
|000007e0| 66 6f 72 65 3f 20 20 44 | 6f 65 73 6e 27 74 20 74 |fore? D|oesn't t|
|000007f0| 68 69 73 20 63 72 65 61 | 74 65 20 73 74 72 61 6e |his crea|te stran|
|00000800| 64 65 64 20 61 64 64 72 | 65 73 73 65 73 20 28 6c |ded addr|esses (l|
|00000810| 65 61 6b 73 29 3f 0a 3e | 0a 3e 0a 0a 20 20 59 65 |eaks)?.>|.>.. Ye|
|00000820| 73 20 74 68 69 73 20 64 | 6f 65 73 20 63 72 65 61 |s this d|oes crea|
|00000830| 74 65 20 6d 65 6d 6f 72 | 79 20 6c 65 61 6b 73 2e |te memor|y leaks.|
|00000840| 20 20 59 6f 75 20 63 61 | 6e 20 61 6c 73 6f 20 63 | You ca|n also c|
|00000850| 72 65 61 74 65 20 6d 65 | 6d 6f 72 79 20 6c 65 61 |reate me|mory lea|
|00000860| 6b 73 20 0a 63 6f 72 72 | 75 70 74 69 6f 6e 20 70 |ks .corr|uption p|
|00000870| 72 6f 62 6c 65 6d 73 2c | 20 64 6f 75 62 6c 65 20 |roblems,| double |
|00000880| 64 65 61 6c 6c 6f 63 61 | 74 69 6f 6e 73 2c 20 65 |dealloca|tions, e|
|00000890| 74 63 2e 20 62 79 20 6e | 6f 74 20 64 65 66 69 6e |tc. by n|ot defin|
|000008a0| 69 6e 67 20 74 68 65 20 | 63 6f 70 79 20 0a 63 6f |ing the |copy .co|
|000008b0| 6e 73 74 72 75 63 74 6f | 72 20 61 6e 64 20 64 65 |nstructo|r and de|
|000008c0| 73 74 72 75 63 74 6f 72 | 2e 0a 0a 0a 3e 54 68 61 |structor|....>Tha|
|000008d0| 6e 6b 73 20 69 6e 20 61 | 64 76 61 6e 63 65 21 0a |nks in a|dvance!.|
|000008e0| 3e 0a 3e 2d 54 79 6c 65 | 72 20 43 6f 6c 77 65 6c |>.>-Tyle|r Colwel|
|000008f0| 6c 0a 0a 0a 2d 2d 20 0a | 2a 2a 2a 2a 2a 2a 2a 2a |l...-- .|********|
|00000900| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000910| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000920| 2a 2a 2a 2a 2a 2a 2a 0a | 42 72 69 61 6e 20 48 69 |*******.|Brian Hi|
|00000930| 62 62 65 72 74 20 20 62 | 5f 68 69 62 62 65 72 74 |bbert b|_hibbert|
|00000940| 40 63 73 63 33 32 2e 65 | 6e 65 74 2e 64 65 63 2e |@csc32.e|net.dec.|
|00000950| 63 6f 6d 0a 44 69 67 69 | 74 61 6c 20 45 71 75 69 |com.Digi|tal Equi|
|00000960| 70 6d 65 6e 74 20 43 6f | 72 70 6f 72 61 74 69 6f |pment Co|rporatio|
|00000970| 6e 0a 41 6c 6c 20 6f 70 | 69 6e 69 6f 6e 73 20 65 |n.All op|inions e|
|00000980| 78 70 72 65 73 73 65 64 | 20 61 72 65 20 6d 79 20 |xpressed| are my |
|00000990| 6f 77 6e 20 61 6e 64 20 | 73 68 6f 75 6c 64 0a 6e |own and |should.n|
|000009a0| 6f 74 20 62 65 20 61 73 | 73 75 6d 65 64 20 74 6f |ot be as|sumed to|
|000009b0| 20 62 65 20 74 68 65 20 | 6f 70 69 6e 69 6f 6e 20 | be the |opinion |
|000009c0| 6f 66 20 6d 79 20 65 6d | 70 6c 6f 79 65 72 0a 0a |of my em|ployer..|
|000009d0| 0a 0a 0a 0a 0a 0a | |...... | |
+--------+-------------------------+-------------------------+--------+--------+